<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>设备通道状态监控</title>
    <!-- 引入外部CSS样式文件 -->
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
    <h1>设备通道状态监控（1-12通道）</h1>
    <div id="tipBox" style="color: green; margin-bottom: 10px; display: none;">
    </div>
    <!-- 控制区域 -->
    <div class="control-panel">
        <div>
            <label for="setChannel">通道号：</label>
            <select id="setChannel">>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
                <option value="6">6</option>
                <option value="7">7</option>
                <option value="8">8</option>
                <option value="9">9</option>
                <option value="10">10</option>
                <option value="11">11</option>
                <option value="12">12</option>
            </select>
        </div>

        <div>
            <!--      <label for="setOutputState">输出状态：</label>-->
            <select id="setOutputState">
                <option value="1">开启</option>
                <option value="0">关闭</option>
            </select>
            <button onclick="handleSetOutput()">设置输出</button>
        </div>

        <div>
            <!--      <label for="setEnableState">使能状态：</label>-->
            <select id="setEnableState">
                <option value="1">开启</option>
                <option value="0">关闭</option>
            </select>
            <button onclick="handleSetEnable()">设置使能</button>
        </div>

        <div>
            <!--      <label for="setCurrentVal">设置电流：</label>-->
            <!-- 电流范围限制：0-6000 -->
            <input type="number" id="setCurrentVal" min="0" max="6000" value="0" placeholder="0-6000 mA">
            <button onclick="handleSetCurrent()">设置电流</button>
        </div>
    </div>

    <div class="refresh-info">
        数据自动刷新间隔：1秒 | 上次刷新时间：<span id="lastRefresh">加载中...</span>
    </div>
    <div id="result">
        <div class="error">加载中，请稍候...</div>
    </div>
</div>
<!-- 引入外部JS脚本文件 -->
<script src="js/script.js"></script>

</body>
</html>